table.insert(itemActions,
	function(item, action)
		-- RARE amazon javelins
		-- Magic is also possible, but these have been disabled by default - kel
		-- see: dir .. "readme.txt" for information regarding these variables
		local priority = 5
		local identify = true
		local dump = true

		if not isPotentialLhJavelin(item) then 
			return false
		elseif action == aPICK and (not item.flags.Identified or isLhJavelin(item)) then
			return priority
		elseif action == aIDENT then
			return identify
		elseif action == aSELL and item.flags.Identified and not isLhJavelin(item) then
			return true
		elseif action == aDUMP and item.flags.Identified and not isLhJavelin(item) then
			return dump
		end

		return false
	end
)

function isPotentialLhJavelin(item)
	return (
			(item.baseItem.code=="ama" or item.baseItem.code=="am5" or item.baseItem.code=="amf") and
			(item.quality == ItemQuality.Magic or item.quality == ItemQuality.Rare)
		)
end

function isLhJavelin(item)
	local ama, java, ias, replen = 0, 0, false, false
	
	for i = 0, item.mods:size() - 1 do
	if (item.mods[i].Stat.Type == StatType.ClassSkillsBonus) then
			ama = item.mods[i].Value
		elseif (item.mods[i].Stat.Type == StatType.SkillTabBonus and 
				item.mods[i].Tab == SkillTab.JavelinAndSpear) then
			java = item.mods[i].Value	
		elseif (item.mods[i].Stat.Type == StatType.FasterAttackRate) then
			ias = true
		elseif (item.mods[i].Stat.Type == StatType.ReplenishQuantity) then
			replen = true
		end
	end
	
	return (
			((java + ama) >= 2) and (ias or replen)
			)
end
